window.main = window.main || {};

qinglan.Canvas.World.globalRes.loadImg(qinglan.Canvas.Config.resource.img, function(img, percent, isload) {
	console.log(img.src + ' ' + percent + ' ' + isload);
	percent == 1 && main.init();
	
});

main.layer = new qinglan.Canvas.Layer('main', 1);

main.pre = function() {

};

main.init = function() {
	setTimeout(function(){
		qinglan.Canvas.World.frm.stop();
	},5000);
	var aimg_stay = new qinglan.Canvas.Img('hakurei', new qinglan.Canvas.Vector2(200, 200) , {
		imgNode: qinglan.Canvas.World.globalRes.getImgById('main_title.png'),
		translateCenter: true,
		offset: new qinglan.Canvas.Vector2(0,131),
		view: new qinglan.Canvas.Vector2(332,66)		
	});

	var star = new qinglan.Canvas.Img('bigC', new qinglan.Canvas.Vector2(200, 200),{
		imgNode: qinglan.Canvas.World.globalRes.getImgById('barrage_boss.png'),
		translateCenter: true,
		offset: new qinglan.Canvas.Vector2(96, 0),
		view: new qinglan.Canvas.Vector2(32, 32)
	});

	var animImg = new qinglan.Canvas.Animate(star,{
		rotation: 120,
		alpha :.6
	},{
		delay: 500,
		equal: qinglan.Tween.Quadratic.easeInOut,
		type: 'to',
		duration: 2000
	});
	animImg.start();
	main.layer.addSprite(animImg);
	qinglan.Canvas.World.frm.addLayer(main.layer);
	

	qinglan.Canvas.World.frm.start();
};
